package com.zq.spring;

import com.zq.spring.config.JavaConfig;
import com.zq.spring.service.impl.UseFunctionService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Author: zhaoqi
 * @Date: 2020/4/24 9:09
 * @Version 1.0
 */

public class AnnotationContextTestJavaConfig {
    public static void main(String[] args) {

        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(JavaConfig.class);
        UseFunctionService useFunctionService = (UseFunctionService) annotationConfigApplicationContext.getBean("useFunctionService");
        UseFunctionService useFunctionService1 =  annotationConfigApplicationContext.getBean(UseFunctionService.class);

        String s  = useFunctionService1.SayHello("hello World");
        System.out.println(s);

    }
}
